import request from '@/config/axios'

// 会议室 VO
export interface MeetingVO {
  id: number // 编号
  name: string // 会议室名称
  schoolCode: string // 所属园区
  isApprove: number //是否需要审核
  userIds: string //审核人员
  sort: number // 排序
  remark: string // 备注
  status: number // 状态
}

// 会议室 API
export const MeetingApi = {
  // 查询会议室分页
  getMeetingPage: async (params: any) => {
    return await request.get({ url: `/school/meeting/page`, params })
  },

  //查询会议室列表（树形结构，提供给级联选择器）
  getMeetingList: async () => {
    return await request.get({ url: `/school/meeting/tree` })
  },

  // 查询会议室详情
  getMeeting: async (id: number) => {
    return await request.get({ url: `/school/meeting/get?id=` + id })
  },

  // 新增会议室
  createMeeting: async (data: MeetingVO) => {
    return await request.post({ url: `/school/meeting/create`, data })
  },

  // 修改会议室
  updateMeeting: async (data: MeetingVO) => {
    return await request.put({ url: `/school/meeting/update`, data })
  },

  // 删除会议室
  deleteMeeting: async (id: number) => {
    return await request.delete({ url: `/school/meeting/delete?id=` + id })
  },

  // 导出会议室 Excel
  exportMeeting: async (params) => {
    return await request.download({ url: `/school/meeting/export-excel`, params })
  }
}
